<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=ISO-8859-1"/>
 <meta name="author" content="Nickolay Ponomarev" />
 <link rel="stylesheet" type="text/css" href="templates.css"/> 
 <title>InfoLister Help: Templates syntax</title>
</head>

<body>

<h1>InfoLister templates syntax</h1>
<p><a href="..">&lt; Back to main page</a></p>

<div id="intro" class="q">
<h2>Introduction</h2>
<p>Since version 0.9, InfoLister supports plain-text templates in addition to previously supported XML+XSLT output mode. Learning InfoLister's template format is considerably easier than learning XSLT or CSS.</p>

<p>A template mostly consists of user markup, ignored by InfoLister. There are only four kinds of text processed by it:</p>
<ul id="proc-text">
  <li><span>Metadata.</span>
    <p>You must provide the display name of your template and the content type of output document in the beginning of the template.</p>
    <p>Any InfoLister template looks like this: <code>content/type<b>;</b>Display Name<b>;</b>(template contents)</code>, i.e. the content type, the display name and the text of your template separated with semicolons.</p>
    <ul>
      <li><q>Content type</q> defines the way the text produced by InfoLister is displayed in InfoLister's window. It doesn't affect the saved file in any way. For example, use <code>text/plain</code> for simple text documents, <code>text/html</code> for HTML and <code>text/xml</code> for XML.</li>
      <li><q>Display name</q> is is the string you see in InfoLister Options when selecting a template. Currently does not apply to custom templates.</li>
      <li>Template text will be used by InfoLister when producing the output document. Its syntax is described below.</li>
    </ul>
    <p>A simple template used to generate just the User agent string would be: <code>text/plain;Just a UA string;%useragent%</code></p>
  </li>

  <li><span>Variables.</span>
    <p>Variables are strings that are replaced by their values by InfoLister. They have this syntax: <code>%variable_name%</code>, i.e. the name of variable enclosed in "%" signs. The list of available variables is available <a href="#vars">below</a>.</p>
  </li>

  <li><span>Lists.</span>
    <p>List templates are used to generate (guess what?) lists of your extensions, themes and plugins. Their syntax is as follows: <code>{{list_name:(template, possibly including %variables%)}}</code>.</p>
    <p>For example: <code>{{extension:&lt;li&gt; %name% ver. %version%}}</code>. Details in a <a href="#lists">separate section</a>.</p>
  </li>

  <li><span>Optional content.</span>
    <p>Optional content may be used to hide certain template text, if you tell InfoLister to exclude certain information from its output. The syntax is: <code>[[(template with %variables% and lists)]]</code>.</p>
    <p>For example,<code>[[User agent: %useragent%]]</code> will not be generated, if you uncheck "user agent" in InfoLister's Options.</p>
  </li>
</ul>
</div>

<div id="vars" class="q">
<h2>Variables</h2>
<p>The following <q>global</q> variables are supported:</p>
<ul>
<li>%app% - the name of application being inspected, e.g. <q>Firefox</q> or <q>Thunderbird</q>.</li>
<li>%lastupd% - the date and time when the information has been collected.</li>
<li>%useragent% - the User agent string of the application.</li>
<li>%extensions_count% - the total number of installed extensions. Will be zero if the extensions checkbox is not selected in InfoLister's Options.</li>
<li>%disabled_extensions_count% - the number of disabled extensions.</li>
<li>%enabled_extensions_count% - the number of enabled extensions.</li>
<li>%themes_count% - the number of installed themes.</li>
<li>%plugins_count% - the number of plugins.</li>
</ul>
</div>

<div id="lists" class="q">
<h2>Lists</h2>
<p>The three list types supported are: <code>extension</code>, <code>theme</code> and <code>plugin</code>. Inside the list template, available variables are different from <a href="#vars">global variables</a>. The following are supported (only %name% applies to plugins):</p>

<ul>
<li>%name% - the display name of an item.</li>
<li>%version% - the version of an item.</li>
<li>%homepageURL% - the home page of an item.</li>
<li>%description% - the description of an item.</li>
<li>%creator% - the author of the item.</li>
<li>%id% - the ID of an item.</li>
<li>%disabled-text% - set to <q>(disabled)</q> for disabled extensions, otherwise empty.</li>
<li>%selected-text% - set to <q>(selected)</q> for the selected theme, otherwise empty.</li>
<li>%xpiLink% - the URL to the XPI with the extension.<br/> Note: unlike the rest of properties, this one requires Internet access. The links are collected from extensions' update manifests, so this will not work for extensions that do not have a valid update manifest (that is, those that neither are hosted at <a href="http://update.mozilla.org/">update.mozilla.org</a>, nor include a valid <code>updateURL</code> property in their <a href="http://developer.mozilla.org/en/docs/Install_Manifests#updateURL">install manifest</a>)</li>
</ul>

</div>

<div class="q">
<h2>Examples</h2>
<p>Four example templates are available (after you install InfoLister) at

<code><a href="chrome://infolister/locale/templates/text.template">chrome://infolister/locale/templates/text.template</a></code>, <code><a href="chrome://infolister/locale/templates/html.template">chrome://infolister/locale/templates/html.template</a></code>, <code><a href="chrome://infolister/locale/templates/bbcode.template">chrome://infolister/locale/templates/bbcode.template</a></code>, and <code><a href="chrome://infolister/locale/templates/xpilist.template">chrome://infolister/locale/templates/xpilist.template</a></code>

(copy and paste to the Location Bar; clicking won't work due to security restrictions)</p>
</div>

<div class="q">
<h2>Contact info</h2>
<p>If you have any questions, corrections or suggestions, feel free to mail me to <a href="mailto:asqueella@gmail.com">asqueella@gmail.com</a>. Please include the word <q>InfoLister</q> in subject line.</p>
</div>

<div>
  <a href="http://validator.w3.org/check?uri=referer"><img style="border:0" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88"/></a>

  <a href="http://jigsaw.w3.org/css-validator/"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/></a>
</div>

</body>
</html>
